package com.atguigu.yygh.hosp.repository;

import com.atguigu.yygh.model.hosp.Department;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created with IntelliJ IDEA
 *
 * @Date: 2022/12/20 - 14:14
 * @Author: Hyoung
 * @Description:
 */
@Repository
public interface DepartmentRepository extends MongoRepository<Department, String> {
    Department findByHoscodeAndDepcode(String hoscode, String depcode);

    /**
     * 根据医院编码查询科室列表
     *
     * @param hoscode
     * @return
     */
    List<Department> findByHoscode(String hoscode);

    /**
     * 根据医院编码查询未删除的科室列表
     *
     * @param hoscode
     * @param i
     * @return
     */
    List<Department> findByHoscodeAndIsDeleted(String hoscode, int i);
}
